<?php
$this->breadcrumbs=array(
	'Manufacturing' => array('manufacturing/index'),
	'Work Orders'
);
?>

<form name="form" method="post" action="<?php echo $this->createUrl("workOrder/form"); ?>">
<input type="hidden" name="form_action" value="" />

<div class="clBoth"></div>
<h2 class='pt'>List of Work Orders</h2><a href="<?php echo $this->createUrl("workOrder/create"); ?>" class="butPrimary"><span>New Work Order</span></a>

<div class="clBoth"></div>

<div class="action-bar">
	<div class="actions">

		<ul>
			<li><span><a href="#" onclick="return SetAction('delete')">Delete</a></span></li>
		</ul>
						
		<div class="clBoth"></div>
	</div>
</div>
<div class="index-wrapper">
<table class="index">	
	<thead>
	
		<tr>
			<td class="col-overflow-left">
				<img height="1" width="40" src="<?php Yii::app()->request->baseUrl; ?>/images/spacer.gif" alt="" />
			</td>
			<td class="col-checkbox">
				<input onClick="return Check_Uncheck(this, 'wo[]')" class="checkbox"  type='checkbox' name='check'>
			</td>
			<th align="left" width='120'><a href="">WO #</a></th>
			<th align="left"><a href="">Location</a></th>
			<th align="center" width='120'><a href="">Start Date</a></th>
			<th align="center" width='120'><a href="">Required By</a></th>
			<th align="left" width='120'><a href="">Accumulated Cost</a></th>
			<td class="col-overflow-right">
				<img height="1" width="40" src="<?php Yii::app()->request->baseUrl; ?>/images/spacer.gif" alt="" />
			</td>
		</tr>
	
	</thead>

	<tbody>
		<?php foreach ($woList as $wo) : ?>
			<tr>
				<td class="col-overflow-left" style="vertical-align:middle"><a class="edit _edit" href="<?php echo $this->createUrl("workOrder/update/id/{$wo->id}"); ?>" rel="6"></a></td>
				<td align='center' style="vertical-align:middle"><input class="checkbox" type='checkbox' name='wo[]' value='<?php echo $wo->id; ?>'></td>
				<td style="vertical-align:middle"><a href="<?php echo $this->createUrl("workOrder/view/id/{$wo->id}"); ?>"><?php echo $wo->wo_number; ?></a></td>
				<td style="vertical-align:middle"><?php echo $wo->location->code; ?></td>
				<td align="center" style="vertical-align:middle"><?php echo $wo->start_date; ?></td>
				<td align="center" style="vertical-align:middle"><?php echo $wo->required_by; ?></td>
				<td style="vertical-align:middle; text-align:right;"><?php echo $wo->accumulated_cost; ?></td>
				<td class="col-overflow-right"></td>
			</tr>
		<?php endforeach; ?>
	    

	</tbody>
</table>			
</div>
</form>

<div id="page">
<?php $this->widget('CLinkPager', array(
    'pages' => $pages,
)) ?>
</div>

